//
//  YXCollectionFooterView.swift
//  SortProject
//
//  Created by ALH000355 on 2021/9/10.
//

import UIKit

class YXCollectionFooterView: UICollectionReusableView {
    var cancelBtn: UIButton!
    var confirmBtn: UIButton!
    required init?(coder: NSCoder) {
        super.init(coder: coder)
    }
    override init(frame: CGRect) {
        super.init(frame: frame)
        cancelBtn = UIButton.init(type: .custom)
        let btnWidth = (self.frame.size.width - 90) / 2
        cancelBtn.frame = CGRect.init(x: 20, y: 30, width: btnWidth, height: 35)
        self.addSubview(cancelBtn)
        cancelBtn.addTarget(self, action: #selector(clickCancel), for: .touchUpInside)
        cancelBtn.setTitle("取消", for: .normal)
        cancelBtn.setTitleColor(.orange, for: .normal)
        cancelBtn.setTitleColor(.gray, for: .highlighted)
        cancelBtn.layer.borderWidth = 1
        cancelBtn.layer.borderColor = UIColor.orange.cgColor
        cancelBtn.layer.cornerRadius = 5
        cancelBtn.layer.masksToBounds = true
        
        confirmBtn = UIButton.init(type: .custom)
        confirmBtn.frame = CGRect.init(x: self.frame.size.width - btnWidth - 20, y: 30, width: btnWidth, height: 35)
        self.addSubview(confirmBtn)
        confirmBtn.addTarget(self, action: #selector(clickConfirm), for: .touchUpInside)
        confirmBtn.setTitle("确定", for: .normal)
        confirmBtn.setTitleColor(.white, for: .normal)
        confirmBtn.setTitleColor(.gray, for: .highlighted)
        confirmBtn.backgroundColor = .orange
        confirmBtn.layer.borderWidth = 1
        confirmBtn.layer.borderColor = UIColor.orange.cgColor
        confirmBtn.layer.cornerRadius = 5
        confirmBtn.layer.masksToBounds = true
        
        self.backgroundColor = .white
    }
    @objc func clickCancel() {
        
    }
    
    @objc func clickConfirm() {
        
    }
}
